package conson.tech.manage.coupons.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import conson.tech.core.response.Response;
import conson.tech.manage.coupons.entity.dto.*;
import conson.tech.manage.coupons.entity.vo.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * InterfaceName: CouponActivityService
 * Description: 领券活动业务接口
 * Author: XYF
 * Date: 2020/7/21 11:24
 * Version: 1.0
 */
public interface CouponActivityService {

    /**
     * 领券活动列表
     *
     * @param pageIndex
     * @param pageSize
     * @param dto
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<conson.tech.manage.coupons.entity.vo.ActivityPageVo>
     */
    Page<ActivityPageVo> couponActivityList(Integer pageIndex, Integer pageSize, ActivityPageDto dto);

    /**
     * 查看领券活动
     *
     * @param id
     * @return conson.tech.core.response.Response
     */
    Response getCouponActivity(Long id);


    /**
     * 作废领券活动
     *
     * @param currentUserId
     * @param id
     * @return conson.tech.core.response.Response
     */
    Response giveUpCouponActivity(Long currentUserId, String currentUsername, Long id);

    /**
     * 强制结束领券活动
     *
     * @param currentUserId
     * @param id
     * @return conson.tech.core.response.Response
     */
    Response overCouponActivity(Long currentUserId, String currentUsername, Long id);

    /**
     * 定向发放导入用户列表
     *
     * @param currentUserId
     * @param file
     * @param id
     * @param response
     * @return conson.tech.core.response.Response
     */
    Response bindingUsers(Long currentUserId, MultipartFile file, Long id, HttpServletResponse response) throws Exception;

    /**
     * 查看发放明细列表
     *
     * @param pageIndex
     * @param pageSize
     * @param dto
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<conson.tech.manage.coupons.entity.vo.BindingDetailVo>
     */
    GrantDetailVo bindingDetail(Integer pageIndex, Integer pageSize, BindingDetailDto dto);


    /**
     * （定时发放通过定时器）修改活动状态
     *
     * @return void
     */
    void updateActivity();

    /**
     * 定时发放优惠券给用户
     *
     * @return void
     */
    void grantCoupons();

    /**
     * 财务结算报表列表
     *
     * @param pageIndex
     * @param pageSize
     * @param dto
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<conson.tech.manage.coupons.entity.vo.FinanceDataPageVo>
     */
    Page<FinanceDataPageVo> financeDataList(Integer pageIndex, Integer pageSize, FinanceDataPageDto dto);

    /**
     * 定时修改发放的优惠券中的优惠券的状态
     *
     * @return void
     */
    void updateCouponState();

    /**
     * 新增领券活动
     *
     * @param currentUserId
     * @param currentUsername
     * @param dto
     * @return conson.tech.core.response.Response
     */
    Response addCouponActivity(Long currentUserId, String currentUsername, ActivitySaveDto dto);

    /**
     * 修改领券活动
     *
     * @param currentUserId
     * @param activityId
     * @param dto
     * @return conson.tech.core.response.Response
     */
    Response editCouponActivity(Long currentUserId, String currentUsername, Long activityId, ActivityEditDto dto);

    /**
     * 领券活动日志列表
     *
     * @param pageIndex
     * @param pageSize
     * @param id
     * @param type
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<conson.tech.manage.coupons.entity.pojo.OperationLog>
     */
    Page<OperationLogVo> couponActivityLogList(Integer pageIndex, Integer pageSize, Long id, Integer type);

    /**
     * 财务结算报表结算
     *
     * @param currentUserId
     * @param currentUsername
     * @param id
     * @return conson.tech.core.response.Response
     */
    Response settleFinanceData(Long currentUserId, String currentUsername, Long id);


    /**
     * 根据录入参数，查询优惠券批次列表
     *
     * @param pageIndex
     * @param pageSize
     * @param dto
     */
    Page<CouponsBatchCenterVo> queryCouponsList(Integer pageSize, Integer pageIndex, CouponsCenterActivityDto dto);

    /**
     * 当前批次优惠券剩余数量
     *
     * @param activityId
     * @return java.lang.Integer
     */
    Integer activityCouponRemain(Long activityId);

    /**
     * 优惠券消息中心列表
     *
     * @param pageIndex
     * @param pageSize
     * @param dto
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<conson.tech.manage.coupons.entity.vo.CouponMessagePageVo>
     */
    Page<CouponMessagePageVo> couponMessageList1(Integer pageIndex, Integer pageSize, CouponMessagePageDto dto);

    /**
     * 月初统计上个月的财务报表
     *
     * @return void
     */
    void settlement();
}
